package com.springboot.common.methodInterceptor;

import lombok.extern.slf4j.Slf4j;
import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.stereotype.Component;

/**
 * @Author: TongRui乀
 * @Date: 2020/3/13 10:51
 * @description： SpringBoot项目中怎么使用接口的实现方式？
 */
@Slf4j
@Component
public class TestMethodInterceptor implements MethodInterceptor {
    @Override
    public Object invoke(MethodInvocation methodInvocation) throws Throwable {

        log.info("方法调用前-TestMethodInterceptor");

        Object result = methodInvocation.proceed();

        log.info("方法调用后-TestMethodInterceptor");

        return result;
    }
}
